//
//  BrlistModel.swift
//
//  Created by eme on 2017/1/3
//  Copyright (c) . All rights reserved.
//

import Foundation
import SwiftyJSON
import ModelProtocol

 class BrlistModel: ModelProtocol ,Copyable {

    // MARK: Declaration for string constants to be used to decode and also serialize.
	internal let kBrlistBrnameKey: String = "brname"
	internal let kBrlistBridKey: String = "brid"


    // MARK: 属性
	 var brname: String
	 var brid: String


    // MARK: 实现MikerSwiftJSONAble 协议， 解析json数据
    required  init?(json: JSON) {
		brname = json[kBrlistBrnameKey].stringValue
		brid = json[kBrlistBridKey].stringValue

    }
    func copy() -> Copyable {
        let br = BrlistModel(json: "")
        br?.brid = self.brid
        br?.brname = self.brname
        return br!
    }

    /**
    Generates description of the object in the form of a NSDictionary.
    - returns: A Key value pair containing all valid values in the object.
    */
    internal func dictionaryRepresentation() -> [String : AnyObject ] {

        var dictionary: [String : AnyObject ] = [ : ]
        
			dictionary.updateValue(brname as AnyObject, forKey: kBrlistBrnameKey)

			dictionary.updateValue(brid as AnyObject, forKey: kBrlistBridKey)
		

        return dictionary
    }


}
